var product_wish;
var client_wish;
var server_path;


$(document).ready(function(){
   server_path = $("#server_path").val();
	$('#whislist_products_table').dataTable();	
	$('#end').datepicker();
})
function edit_discount(client,product){
	product_wish = product;
	client_wish=client;
	sendData = 'get_discount=1+&product='+product+'&client='+client;
	$("#discount_form")[0].reset();
	$.ajax({
         type: "POST",
         url: server_path+"libs/client_wishlist_ajax.php",
         data: sendData,
         dataType:'json',
         success: function(data){ 
         	$.each(data,function(key,value){
         		$("#"+key).val(value);
         		if(key == 'active'){
         			$("#active").html(value);
         		}
         	})
         	$("#modal-clients-data").modal();
         }
     }); 	
}
function save_discount(){
	sendData = $("#discount_form").serialize()+'&send_discount=1+&product='+product_wish+'&client='+client_wish;
	$.ajax({
         type: "POST",
         url: server_path+"libs/client_wishlist_ajax.php",
         data: sendData,
         dataType:'json',
         success: function(data){ 
         	
         }
     }); 	
}